//导入instance
import instance from '@/utils/request'
//获取组织架构接口
export function getDepartmentsApi () {
  return instance({
    url: '/company/department'
  })
}
//删除组织架构接口
export function delDepartmentsApi (id) {
  return instance({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
//新增部门接口
export function addDepartmentsApi (data) {
  return instance({
    url: '/company/department',
    method: 'POST',
    data
  })
}

//获取部门负责人的接口
export function getDepartmentsListApi () {
  return instance({
    url: '/sys/user/simple'
  })
}

//根据ID查询部门详情接口
export function getDepartmentsByIdApi (id) {
  return instance({
    url: `/company/department/${id}`
  })
}

//根据ID修改部门详情接口
export function EditDepartmentsByIdApi (data) {
  return instance({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
